package com.tz.crm.dao.impl;

import com.tz.crm.dao.ContractTemplateDao;
import com.tz.crm.entity.ContractTemplate;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 使用 @Repository 将 DAO 类声明为 Bean
 */
@Repository
@Transactional
public class ContractTemplateDaoImpl extends
        BaseDaoImpl<ContractTemplate, String> implements ContractTemplateDao {

    @Override
    @SuppressWarnings("unchecked")
    public List<ContractTemplate> getUsingTemplates() {
        String hql = "from ContractTemplate where status=true";
        return getSession().createQuery(hql).list();
    }
}
